<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<script>
			// var x = 10;
			// console.log(x);//输出10
			// {
			// 	var x = 100;
			// 	console.log(x);//输出100
			// }
			// console.log(x);//输出100


			//es6新标准
			let x = 10;
			console.log(x); //10
			{
				let x = 100;
				console.log(x); //100
			}
			//var和let区别：代码段中let定义变量作用于，代码段结束，里面x的值也结束
			console.log(x); //100
			
			const PI = 3.14;//const修饰的是常量
			console.log(PI);
			//PI = 3.1415926;已经是常量了不能被赋值
			
			
		</script>
	</head>
	<body>
	</body>
</html>
